export function parseLyric(lyric) {
  const lyricInfos = []
  const lyricLine = lyric.split('\n')
  const timeReg = /\[(\d{2}):(\d{2})\.(\d{2,3})\]/
  // 目标  解析成 [{text: '123',time: 2000}]
  for(var lyricString of lyricLine) {
    const result = timeReg.exec(lyricString)
    if(!result) continue
    const minutes = result[1] * 60 * 1000
    const second = result[2] * 1000
    const mSecond =  result[3].length === 3 ? result[3] * 1 : result[3] * 10
    const time = minutes + second + mSecond
    const text = lyricString.replace(timeReg,"")
    lyricInfos.push({text,time})
  }
  return lyricInfos
}